import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            int a = in.nextInt();
            int[] array = new int[n];
            int sum = 0;
            for (int i = 0; i < array.length; i++) {
                array[i] = in.nextInt();
                a += beatMaster(a,array[i]);
            }
            System.out.println(a);
        }
    }
    // 20+10=30  60+15 = 75 +40 +100 = 215
    public static int  beatMaster(int i, int j) {
        if (i >= j) {
            return j;
        }
        return div(i,j);
    }

    public static int div(int a, int b) {
        int i = b % a;
        while (i != 0) {
            b = a;
            a = i;
            i = b % a;
        }
        return a;
    }
}